package com;

import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.bean.Teacher;
import com.opensymphony.xwork2.ActionSupport;
import com.service.TeacherService;

public class DeleteTeacherAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Resource(type=Teacher.class)
	private Teacher teacher;
	
	@Autowired
	@Qualifier("teacherService")
	private TeacherService teacherService;


	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		try {
			teacherService.DeleteTeacher(teacher);
			return SUCCESS;
		}
		catch (Exception e)
		{
			e.printStackTrace();
			return ERROR;
		}
	}

}
